<template>
  <div class="app-container" style="">
    <el-row style="pading:5px;">
      <headOfThisProject :projectinfo="projectinfo" ref="projectHeader" style=""></headOfThisProject>
    </el-row>
    <el-row style="pading:10px;">
      <projectItemTab :projectRoleCode="projectRoleCode" :projectinfo="projectinfo" style=""></projectItemTab>
    </el-row>
  </div>
</template>

<script>
import headOfThisProject from './components/headOfThisProject'
import projectItemTab from './components/projectItemTab'
import projectDetail from './components/projectDetail'
import speedOfProgress from './components/speedOfProgress'
import projectOthersInfo from './components/projectOthersInfo'
import { getAction, putAction, postAction } from '@tapui/utils/http'

// 项目信息页面
export default {
  name: 'projectInfoIndex',
  components: {
    headOfThisProject,
    projectItemTab,
    projectDetail,
    speedOfProgress,
    projectOthersInfo
  },
  // mixins: [mixin_list],
  data() {
    return {
      projectid: '',
      projectinfo: {},
      projectRoleCode: -1
    }
  },

  methods: {
    getProjectInfo() {
      getAction('pm/project/load', { id: this.projectid }).then(result => {
        this.projectinfo = result.result
        this.getProjectRoleCode()
      })
    },
    getProjectRoleCode() {
      getAction('pm/project/getProjectRole', { projectId: this.projectinfo.id }).then(res => {
        if (res.statusCode !== 200) {
          // this.$tap.alert(`提示：${res.message}`, 'warning')
          return
        }

        if (JSON.stringify(res.result) !== 'null') {
          console.log(JSON.stringify(res.result))
          this.projectRoleCode = res.result
        } else {
          // this.$tap.alert(`提示：没有项目角色！`, 'warning')
          this.projectRoleCode = 0
        }
      })
    }
  },
  created() {
    this.projectid = this.$route.params.id
    this.getProjectInfo()
  },
  watch: {}
}
</script>

<style scoped>
.app-container {
  padding: 5px;
  /* padding-left: 5px; */
}
.app-container >>> .el-divider--vertical {
  height: 100%;
}
.el-tabs__nav-wrap {
  padding-bottom: 10px !important;
}
.app-container >>> .el-row {
  padding-bottom: 5px;
}
.app-container >>> .el-dialog__body .el-row {
  padding-bottom: 0px;
  padding-top: 0px;
}

.app-container >>> div.el-card__header {
  background: #f7f7f7;
  height: 40px;
  line-height: 5px;
  border-bottom: 1px solid #d3d3d3 !important;
  /* padding: 10px !important; */
}
.app-container >>> .el-tabs__nav-scroll {
  padding-bottom: 5px;
}
.clearfix {
  height: 40px;
  line-height: 40px;
  text-indent: 10px;
}
</style>
